The present invention relates generally to memory management in a computer system and, specifically, to a memory management system for a computer system having multiple levels of virtual memory mapping tables.
Many types of general purpose computers and data processing systems contain memory that is organized using a "virtual memory" scheme. In general virtual memory allows applications and/or processes that are executing in the computer to behave as if they have an unlimited amount of memory at their disposal. In actuality, the amount of memory available to a particular application or process is limited by the amount of memory in the data processing system and further limited by the number of concurrently executing programs sharing that memory. In addition, a virtual memory scheme hides the actual physical address of memory from the application programs. Application programs access their memory space using a logical address, which is then converted to a physical address by the data processing system.
A virtual memory system organizes memory in units called "pages." These pages are moved between a fast, primary memory and one or more larger and usually slower secondary, tertiary, etc. memories. The movement of pages (often called "swapping") is transparent to the applications or processes that are executed in the data processing system, enabling the applications or processes to behave as if they each have an unlimited amount of memory.
Certain conventional systems occasionally need to copy portions of memory. This copy can either be user-initiated or initiated by the operating system. Conventional systems often use a "lazy" copy method in which the memory to be copied is assigned a status of read-only, but the actual copy is deferred until later. If an attempt is made to write into either the original or the copy, the memory is then copied at that time and both the original and the copy are given an I/O status of read-write. In this way, it appears that a copy was made immediately, but the actual copying is deferred until the last possible time. If no write is performed, no copying ever occurs. For this reason, this method is called "copy on write" or "virtual copy." This method is used, for example to implement the Unix and Posix "fork" operation, which copy the entire private memory of a process. Unix and Posix do not allow two processes to share memory that is subject to copy on write.